home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™ 1987-1994 / MacHack™ '90 / MacHack 90 Contest Entries / Surovell Stuffƒ / GeeWhizƒ / PixMapFileIO.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-13  |  2.2 KB  |  107 lines  |  [TEXT/KAHL]

  1. /*
  2.     Copyright © 1988,1989,1990 by Succinct Systems
  3.  
  4.     433 Huronview
  5.     Ann Arbor, MI 48103
  6.     (313) 663-4903
  7.  
  8.     File:         PixMapFileIO.h
  9.     Model:         THINK C 4.0, MPW C 3.0
  10.  
  11.     ABSTRACT:
  12.         PICT file i/o routines, QuickDraw-32 compatible
  13.  
  14.     NOTES:
  15.         saving 32-bit PixMaps requires a lot of temporary heap space for CopyBits
  16.         calls; if your application saves empty (all black) pictures, increase
  17.         its’ partition size!
  18.  
  19.     KNOWN BUGS:
  20.         ---
  21.  
  22.     HISTORY:
  23.         DAS 14-Jul-89    created this file    (David A. Surovell)
  24.         DAS 26-Oct-89    added “rect of interest” control
  25.         DAS 21-Apr-90    cleanly separated PICT <--> PixMap and PICT i/o operations
  26.                         added MacPaint B&W file reading
  27.         DAS 27-May-90    added new high-level I/O call discipline
  28.         DAS 08-Jun-90    collected file system arguments into single structure argument
  29. */
  30.  
  31. #define _H_PixMapFileIO
  32.  
  33. #include <Color.h>
  34.  
  35.  
  36. #define PICTIO_headersize          512L        /* PICT file header byte count */
  37.  
  38. #define PAINTIO_headersize        512L    /* standard for a MacPaint image */
  39. #define PAINTIO_rowbytes        72        /*         "        "        "         */
  40. #define PAINTIO_width            576L    /*         "        "        "         */
  41. #define PAINTIO_height            720L    /*         "        "        "         */
  42. #define PAINTIO_blocksize        1024L
  43.  
  44. typedef struct
  45. {
  46.     long        dirID;
  47.     short        volumeID;
  48.     short        fileRefNum;
  49.     char        fileName[256];
  50. } FSInfoRec;
  51.  
  52. typedef struct
  53. {
  54.     OSType        fType;                    /* 4 bytes */
  55.     short        hdrID;                    /* 2 bytes */
  56.     short        version;                /* 2 bytes */
  57. } MacDrawFHeader;
  58.  
  59.  
  60. OSErr Open_pixel_file(
  61.     PixMapHandle    thePixels,
  62.     Point            *pmBounds,
  63.     FSInfoRec        *fileSysData );
  64.  
  65. OSErr Read_pixel_file(
  66.     PixMapHandle    thePixels,
  67.     Point            *pmBounds,
  68.     FSInfoRec        *fileSysData );
  69.  
  70.  
  71. OSErr Save_pixel_file(
  72.     PixMapHandle    thePixels,
  73.     Rect            *rectOfInterest,
  74.     FSInfoRec        *fileSysData );
  75.  
  76. OSErr Write_pixel_file(
  77.     PixMapHandle    thePixels,
  78.     Rect            *rectOfInterest,
  79.     FSInfoRec        *fileSysData );
  80.  
  81. OSErr Save_GDevice_pixels(
  82.     GDHandle    targetGD,
  83.     Rect        *rectOfInterest,
  84.     FSInfoRec    *fileSysData );
  85.  
  86. OSErr Read_pict_file(
  87.     PicHandle    *thePictHdl,
  88.     FSInfoRec    *fileSysData );
  89.  
  90. OSErr Write_pict_file(
  91.     PicHandle    thePictHdl,
  92.     FSInfoRec    *fileSysData );
  93.  
  94. OSErr Read_paint_file(
  95.     BitMap        *theBits,
  96.     FSInfoRec    *fileSysData );
  97.  
  98. PicHandle PixMap_CreatePict(
  99.     PixMapHandle    thePixels,
  100.     Rect            *rectOfInterest );
  101.  
  102. void FSInfo_Init(
  103.     FSInfoRec    *fileSysData );
  104.  
  105. Boolean FSInfo_Valid(
  106.     FSInfoRec    *fileSysData );
  107.